<% layout('/layouts/default.html', {title: '数据管理', libs:
['validate','fileupload','ueditor','dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(ztAdmin.isNewRecord ? '新增用户' :
				'编辑用户')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool"
					data-widget="collapse">
					<i class="fa fa-minus"></i>
				</button>
			</div>
		</div>
		<#form:form id="inputForm" model="${ztAdmin}"
		action="${ctx}/ztAdmin/save" method="post" class="form-horizontal">
		<div class="box-body">
			<div class="form-unit">${text('用户信息')}</div>
			<#form:hidden path="id"/>
			
			<input type="hidden" name="oleMemType" value="${ztAdmin.memtype}"/>
			
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('微信名')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="username"
							maxlength="40" class="form-control required "/></div>
					</div>
				</div>
				
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required "></span> ${text('姓名')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="name"
							maxlength="40" class="form-control"/></div>
					</div>
				</div>
			</div>

			<div class="row">
				
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required">*</span> ${text('会员类型')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:select path="level" 
							dictType="sys_level_type" blankOption="true" class="form-control required" />
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> ${text('号码')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="phone"
							onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');"
							maxlength="18" class="form-control"/></div>
					</div>
				</div>
				
			</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('微信openid')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="openid"
							class="form-control" disabled="disabled"/></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('ID')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="bid"
							class="form-control" disabled="disabled"/></div>
					</div>
				</div>	
			</div>
			
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('我的邀请人')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="lastadmin"
							class="form-control" disabled="disabled"/></div>
					</div>
				</div>
					
			</div>
			
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('已使用余额')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="amount"
							class="form-control" disabled="disabled"/></div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
							class="required ">*</span> ${text('可提现金额')}：<i
							class="fa icon-question hide"></i></label>
						<div class="col-sm-8"><#form:input path="cashAmount"
							class="form-control" disabled="disabled"/></div>
					</div>
				</div>	
			</div>
			<div class="row">
	
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('首次登录时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="firstDate" readonly="true" maxlength="20" class="form-control Wdate"
									dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"  disabled="disabled"/>
							</div>
						</div>
					</div>
					
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('最后登录时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="endDate" readonly="true" maxlength="20" class="form-control Wdate"
									dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"  disabled="disabled"/>
							</div>
						</div>
					</div>
			</div>
		<!--	<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('归属公司')}：<i
								class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<select name='companyId' style="width:auto;min-width: 90px;padding:6px;border-color:#d2d6de"></select>
						</div>

					</div>
				</div>
			</div>-->

			
			

		</div>
		<div class="box-footer">
			<div class="row">
				<div class="col-sm-offset-2 col-sm-10">
					<% if (hasPermi('admin:adminData:edit')){ %>
					<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit">
						<i class="fa fa-check"></i> ${text('保 存')}
					</button>
					&nbsp; <% } %>
					<button type="button" class="btn btn-sm btn-default" id="btnCancel"
						onclick="js.closeCurrentTabPage()">
						<i class="fa fa-reply-all"></i> ${text('关 闭')}
					</button>
				</div>
			</div>
		</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
	/*// 初始化第一类型
	initAddress();

	// 更改省份后的操作
	$("select[name='companyId']").change(function() {
		var provCode = $("select[name='companyId']").val();
	});


	function initAddress() {

		// ajax请求所有省份
		$.get("${ctx}/ztCompany/listData", {
		}, function(data) {
			$("select[name='companyId']").empty();

			$("select[name='companyId']").append("<option value='0'>其他用户</option>");
			$.each(data.list, function(i, d) {
				$("select[name='companyId']").append("<option value='"+d.company+"'>"+ d.companyname +"</option>");
			});

		}, 'json');

	}*/
function openWin(u, w, h) { 
    var l = (screen.width - w) / 2; 
    var t = (screen.height - h) / 2; 
    var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l; 
    s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no'; 
    open(u, 'oWin', s); 
} 

	
window.onload=function (){

	$("#uploadFiledndArea p").text("或将视频拖到这里,最多可选 1 个");

}


	$("#inputForm").validate({
		submitHandler : function(form) {
			js.ajaxSubmitForm($(form), function(data) {
				js.showMessage(data.message);
				if (data.result == Global.TRUE) {
					js.closeCurrentTabPage(function(contentWindow) {
						contentWindow.page();
					});
				}
			}, "json");
		}
	});
</script>